<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image"  data-rule="required"  class="form-control" size="50" name="row[image]" type="text" value="{$row.image}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text"
                   value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Least')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-least" data-rule="required" class="form-control" name="row[least]" max="99999999" type="number"
                   value="{$row.least|htmlentities}" min="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Value')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-value" data-rule="required" class="form-control" step="0.01" name="row[value]" max="99999999" type="number"
                   value="{$row.value|htmlentities}" min="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Starttime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-starttime" data-rule="required" class="form-control datetimepicker"
                   data-date-format="YYYY-MM-DD" data-use-current="true" name="row[starttime]" type="text"
                   value="{:$row.starttime?date('Y-m-d',$row.starttime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Endtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-endtime" data-rule="required" class="form-control datetimepicker"
                   data-date-format="YYYY-MM-DD" data-use-current="true" name="row[endtime]" type="text"
                   value="{:$row.endtime?date('Y-m-d',$row.endtime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                {foreach name="typeList" item="vo"}
                <label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}"
                                                     {in name="key" value="$row.type" }checked{/in} /> {$vo}</label>
                {/foreach}
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Distribute')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-distribute" data-rule="required" placeholder="" class="form-control" name="row[distribute]" max="99999999" type="number" min="1" value="{$row.distribute}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Limit')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-limit" data-rule="required" placeholder="" class="form-control" name="row[limit]" max="99999999" type="number" min="1" value="{$row.limit}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Score')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-score" data-rule="" placeholder="required" class="form-control" name="row[score]" max="99999999" type="number"
                   min="0" value="{$row.score}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Exchange code')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-exchange_code" data-rule="" class="form-control" name="row[exchange_code]" type="text" maxlength="32"
                   value="{$row.exchange_code}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Shop')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[shop_id]', $shopData, $row.shop_id, ['class'=>'form-control selectpicker', 'data-rule'=>''])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Instructions')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-instructions" class="form-control editor" rows="5" name="row[instructions]"
                      cols="50">{$row.instructions}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Switch')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-switch" name="row[switch]" type="hidden" value="{$row.switch}">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch" data-yes="1"
               data-no="0">
                <i class="fa fa-toggle-on text-success {eq name=" $row.switch" value="0"}fa-flip-horizontal
                text-gray{/eq} fa-2x"></i>
            </a>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
